//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS QApps service.
///
/// The Amazon Q Apps feature capability within Amazon Q Business allows web experience users to create lightweight, purpose-built AI apps to fulfill specific tasks from within their web experience. For example, users can create a Q App that exclusively generates marketing-related content to improve your marketing team's productivity or a Q App for writing customer emails and creating promotional content using a certain style of voice, tone, and branding. For more information on the capabilities, see Amazon Q Apps capabilities in the Amazon Q Business User Guide.  For an overview of the Amazon Q App APIs, see Overview of Amazon Q Apps API operations. For information about the IAM access control permissions you need to use the Amazon Q Apps API, see  IAM role for the Amazon Q Business web experience including Amazon Q Apps in the Amazon Q Business User Guide.
public struct QApps: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the QApps client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "QApps",
            serviceIdentifier: "data.qapps",
            signingName: "qapps",
            serviceProtocol: .restjson,
            apiVersion: "2023-11-27",
            endpoint: endpoint,
            errorType: QAppsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Associates a rating or review for a library item with the user submitting the request. This increments the rating count for the specified library item.
    @Sendable
    @inlinable
    public func associateLibraryItemReview(_ input: AssociateLibraryItemReviewInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "AssociateLibraryItemReview", 
            path: "/catalog.associateItemRating", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Associates a rating or review for a library item with the user submitting the request. This increments the rating count for the specified library item.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier for the Amazon Q Business application environment instance.
    ///   - libraryItemId: The unique identifier of the library item to associate the review with.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateLibraryItemReview(
        instanceId: String,
        libraryItemId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = AssociateLibraryItemReviewInput(
            instanceId: instanceId, 
            libraryItemId: libraryItemId
        )
        return try await self.associateLibraryItemReview(input, logger: logger)
    }

    /// This operation creates a link between the user's identity calling the operation and a specific Q App. This is useful to mark the Q App as a favorite for the user if the user doesn't own the Amazon Q App so they can still run it and see it in their inventory of Q Apps.
    @Sendable
    @inlinable
    public func associateQAppWithUser(_ input: AssociateQAppWithUserInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "AssociateQAppWithUser", 
            path: "/apps.install", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This operation creates a link between the user's identity calling the operation and a specific Q App. This is useful to mark the Q App as a favorite for the user if the user doesn't own the Amazon Q App so they can still run it and see it in their inventory of Q Apps.
    ///
    /// Parameters:
    ///   - appId: The ID of the Amazon Q App to associate with the user.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateQAppWithUser(
        appId: String,
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = AssociateQAppWithUserInput(
            appId: appId, 
            instanceId: instanceId
        )
        return try await self.associateQAppWithUser(input, logger: logger)
    }

    /// Creates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
    @Sendable
    @inlinable
    public func batchCreateCategory(_ input: BatchCreateCategoryInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "BatchCreateCategory", 
            path: "/catalog.createCategories", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
    ///
    /// Parameters:
    ///   - categories: The list of category objects to be created
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchCreateCategory(
        categories: [BatchCreateCategoryInputCategory],
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = BatchCreateCategoryInput(
            categories: categories, 
            instanceId: instanceId
        )
        return try await self.batchCreateCategory(input, logger: logger)
    }

    /// Deletes Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
    @Sendable
    @inlinable
    public func batchDeleteCategory(_ input: BatchDeleteCategoryInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "BatchDeleteCategory", 
            path: "/catalog.deleteCategories", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
    ///
    /// Parameters:
    ///   - categories: The list of IDs of the categories to be deleted.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchDeleteCategory(
        categories: [String],
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = BatchDeleteCategoryInput(
            categories: categories, 
            instanceId: instanceId
        )
        return try await self.batchDeleteCategory(input, logger: logger)
    }

    /// Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
    @Sendable
    @inlinable
    public func batchUpdateCategory(_ input: BatchUpdateCategoryInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "BatchUpdateCategory", 
            path: "/catalog.updateCategories", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
    ///
    /// Parameters:
    ///   - categories: The list of categories to be updated with their new values.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchUpdateCategory(
        categories: [CategoryInput],
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = BatchUpdateCategoryInput(
            categories: categories, 
            instanceId: instanceId
        )
        return try await self.batchUpdateCategory(input, logger: logger)
    }

    /// Creates a new library item for an Amazon Q App, allowing it to be discovered and used by other allowed users.
    @Sendable
    @inlinable
    public func createLibraryItem(_ input: CreateLibraryItemInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateLibraryItemOutput {
        try await self.client.execute(
            operation: "CreateLibraryItem", 
            path: "/catalog.createItem", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new library item for an Amazon Q App, allowing it to be discovered and used by other allowed users.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Amazon Q App to publish to the library.
    ///   - appVersion: The version of the Amazon Q App to publish to the library.
    ///   - categories: The categories to associate with the library item for easier discovery.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func createLibraryItem(
        appId: String,
        appVersion: Int,
        categories: [String],
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateLibraryItemOutput {
        let input = CreateLibraryItemInput(
            appId: appId, 
            appVersion: appVersion, 
            categories: categories, 
            instanceId: instanceId
        )
        return try await self.createLibraryItem(input, logger: logger)
    }

    /// Creates a presigned URL for an S3 POST operation to upload a file. You can use this URL to set a default file for a FileUploadCard in a Q App definition or to provide a file for a single Q App run. The scope parameter determines how the file will be used, either at the app definition level or the app session level.  The IAM permissions are derived from the qapps:ImportDocument action. For more information on the IAM policy for Amazon Q Apps, see IAM permissions for using Amazon Q Apps.
    @Sendable
    @inlinable
    public func createPresignedUrl(_ input: CreatePresignedUrlInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreatePresignedUrlOutput {
        try await self.client.execute(
            operation: "CreatePresignedUrl", 
            path: "/apps.createPresignedUrl", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a presigned URL for an S3 POST operation to upload a file. You can use this URL to set a default file for a FileUploadCard in a Q App definition or to provide a file for a single Q App run. The scope parameter determines how the file will be used, either at the app definition level or the app session level.  The IAM permissions are derived from the qapps:ImportDocument action. For more information on the IAM policy for Amazon Q Apps, see IAM permissions for using Amazon Q Apps.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Q App the file is associated with.
    ///   - cardId: The unique identifier of the card the file is associated with.
    ///   - fileContentsSha256: The Base64-encoded SHA-256 digest of the contents of the file to be uploaded.
    ///   - fileName: The name of the file to be uploaded.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - scope: Whether the file is associated with a Q App definition or a specific Q App session.
    ///   - sessionId: The unique identifier of the Q App session the file is associated with, if applicable.
    ///   - logger: Logger use during operation
    @inlinable
    public func createPresignedUrl(
        appId: String,
        cardId: String,
        fileContentsSha256: String,
        fileName: String,
        instanceId: String,
        scope: DocumentScope,
        sessionId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreatePresignedUrlOutput {
        let input = CreatePresignedUrlInput(
            appId: appId, 
            cardId: cardId, 
            fileContentsSha256: fileContentsSha256, 
            fileName: fileName, 
            instanceId: instanceId, 
            scope: scope, 
            sessionId: sessionId
        )
        return try await self.createPresignedUrl(input, logger: logger)
    }

    /// Creates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.
    @Sendable
    @inlinable
    public func createQApp(_ input: CreateQAppInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateQAppOutput {
        try await self.client.execute(
            operation: "CreateQApp", 
            path: "/apps.create", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.
    ///
    /// Parameters:
    ///   - appDefinition: The definition of the new Q App, specifying the cards and flow.
    ///   - description: The description of the new Q App.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - tags: Optional tags to associate with the new Q App.
    ///   - title: The title of the new Q App.
    ///   - logger: Logger use during operation
    @inlinable
    public func createQApp(
        appDefinition: AppDefinitionInput,
        description: String? = nil,
        instanceId: String,
        tags: [String: String]? = nil,
        title: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateQAppOutput {
        let input = CreateQAppInput(
            appDefinition: appDefinition, 
            description: description, 
            instanceId: instanceId, 
            tags: tags, 
            title: title
        )
        return try await self.createQApp(input, logger: logger)
    }

    /// Deletes a library item for an Amazon Q App, removing it from the library so it can no longer be discovered or used by other users.
    @Sendable
    @inlinable
    public func deleteLibraryItem(_ input: DeleteLibraryItemInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteLibraryItem", 
            path: "/catalog.deleteItem", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a library item for an Amazon Q App, removing it from the library so it can no longer be discovered or used by other users.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - libraryItemId: The unique identifier of the library item to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteLibraryItem(
        instanceId: String,
        libraryItemId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteLibraryItemInput(
            instanceId: instanceId, 
            libraryItemId: libraryItemId
        )
        return try await self.deleteLibraryItem(input, logger: logger)
    }

    /// Deletes an Amazon Q App owned by the user. If the Q App was previously published to the library, it is also removed from the library.
    @Sendable
    @inlinable
    public func deleteQApp(_ input: DeleteQAppInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteQApp", 
            path: "/apps.delete", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an Amazon Q App owned by the user. If the Q App was previously published to the library, it is also removed from the library.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Q App to delete.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteQApp(
        appId: String,
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteQAppInput(
            appId: appId, 
            instanceId: instanceId
        )
        return try await self.deleteQApp(input, logger: logger)
    }

    ///  Describes read permissions for a Amazon Q App in Amazon Q Business application environment instance.
    @Sendable
    @inlinable
    public func describeQAppPermissions(_ input: DescribeQAppPermissionsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeQAppPermissionsOutput {
        try await self.client.execute(
            operation: "DescribeQAppPermissions", 
            path: "/apps.describeQAppPermissions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Describes read permissions for a Amazon Q App in Amazon Q Business application environment instance.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Amazon Q App for which to retrieve permissions.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeQAppPermissions(
        appId: String,
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeQAppPermissionsOutput {
        let input = DescribeQAppPermissionsInput(
            appId: appId, 
            instanceId: instanceId
        )
        return try await self.describeQAppPermissions(input, logger: logger)
    }

    /// Removes a rating or review previously submitted by the user for a library item.
    @Sendable
    @inlinable
    public func disassociateLibraryItemReview(_ input: DisassociateLibraryItemReviewInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DisassociateLibraryItemReview", 
            path: "/catalog.disassociateItemRating", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes a rating or review previously submitted by the user for a library item.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - libraryItemId: The unique identifier of the library item to remove the review from.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateLibraryItemReview(
        instanceId: String,
        libraryItemId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DisassociateLibraryItemReviewInput(
            instanceId: instanceId, 
            libraryItemId: libraryItemId
        )
        return try await self.disassociateLibraryItemReview(input, logger: logger)
    }

    /// Disassociates a Q App from a user removing the user's access to run the Q App.
    @Sendable
    @inlinable
    public func disassociateQAppFromUser(_ input: DisassociateQAppFromUserInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DisassociateQAppFromUser", 
            path: "/apps.uninstall", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disassociates a Q App from a user removing the user's access to run the Q App.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Q App to disassociate from the user.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateQAppFromUser(
        appId: String,
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DisassociateQAppFromUserInput(
            appId: appId, 
            instanceId: instanceId
        )
        return try await self.disassociateQAppFromUser(input, logger: logger)
    }

    /// Exports the collected data of a Q App data collection session.
    @Sendable
    @inlinable
    public func exportQAppSessionData(_ input: ExportQAppSessionDataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ExportQAppSessionDataOutput {
        try await self.client.execute(
            operation: "ExportQAppSessionData", 
            path: "/runtime.exportQAppSessionData", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Exports the collected data of a Q App data collection session.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App data collection session.
    ///   - logger: Logger use during operation
    @inlinable
    public func exportQAppSessionData(
        instanceId: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ExportQAppSessionDataOutput {
        let input = ExportQAppSessionDataInput(
            instanceId: instanceId, 
            sessionId: sessionId
        )
        return try await self.exportQAppSessionData(input, logger: logger)
    }

    /// Retrieves details about a library item for an Amazon Q App, including its metadata, categories, ratings, and usage statistics.
    @Sendable
    @inlinable
    public func getLibraryItem(_ input: GetLibraryItemInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetLibraryItemOutput {
        try await self.client.execute(
            operation: "GetLibraryItem", 
            path: "/catalog.getItem", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves details about a library item for an Amazon Q App, including its metadata, categories, ratings, and usage statistics.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Amazon Q App associated with the library item.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - libraryItemId: The unique identifier of the library item to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func getLibraryItem(
        appId: String? = nil,
        instanceId: String,
        libraryItemId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetLibraryItemOutput {
        let input = GetLibraryItemInput(
            appId: appId, 
            instanceId: instanceId, 
            libraryItemId: libraryItemId
        )
        return try await self.getLibraryItem(input, logger: logger)
    }

    /// Retrieves the full details of an Q App, including its definition specifying the cards and flow.
    @Sendable
    @inlinable
    public func getQApp(_ input: GetQAppInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQAppOutput {
        try await self.client.execute(
            operation: "GetQApp", 
            path: "/apps.get", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the full details of an Q App, including its definition specifying the cards and flow.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Q App to retrieve.
    ///   - appVersion: The version of the Q App.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQApp(
        appId: String,
        appVersion: Int? = nil,
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQAppOutput {
        let input = GetQAppInput(
            appId: appId, 
            appVersion: appVersion, 
            instanceId: instanceId
        )
        return try await self.getQApp(input, logger: logger)
    }

    /// Retrieves the current state and results for an active session of an Amazon Q App.
    @Sendable
    @inlinable
    public func getQAppSession(_ input: GetQAppSessionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQAppSessionOutput {
        try await self.client.execute(
            operation: "GetQAppSession", 
            path: "/runtime.getQAppSession", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the current state and results for an active session of an Amazon Q App.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App session to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQAppSession(
        instanceId: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQAppSessionOutput {
        let input = GetQAppSessionInput(
            instanceId: instanceId, 
            sessionId: sessionId
        )
        return try await self.getQAppSession(input, logger: logger)
    }

    /// Retrieves the current configuration of a Q App session.
    @Sendable
    @inlinable
    public func getQAppSessionMetadata(_ input: GetQAppSessionMetadataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQAppSessionMetadataOutput {
        try await self.client.execute(
            operation: "GetQAppSessionMetadata", 
            path: "/runtime.getQAppSessionMetadata", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the current configuration of a Q App session.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App session.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQAppSessionMetadata(
        instanceId: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQAppSessionMetadataOutput {
        let input = GetQAppSessionMetadataInput(
            instanceId: instanceId, 
            sessionId: sessionId
        )
        return try await self.getQAppSessionMetadata(input, logger: logger)
    }

    /// Uploads a file that can then be used either as a default in a FileUploadCard from Q App definition or as a file that is used inside a single Q App run. The purpose of the document is determined by a scope parameter that indicates whether it is at the app definition level or at the app session level.
    @Sendable
    @inlinable
    public func importDocument(_ input: ImportDocumentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ImportDocumentOutput {
        try await self.client.execute(
            operation: "ImportDocument", 
            path: "/apps.importDocument", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Uploads a file that can then be used either as a default in a FileUploadCard from Q App definition or as a file that is used inside a single Q App run. The purpose of the document is determined by a scope parameter that indicates whether it is at the app definition level or at the app session level.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Q App the file is associated with.
    ///   - cardId: The unique identifier of the card the file is associated with.
    ///   - fileContentsBase64: The base64-encoded contents of the file to upload.
    ///   - fileName: The name of the file being uploaded.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - scope: Whether the file is associated with a Q App definition or a specific Q App session.
    ///   - sessionId: The unique identifier of the Q App session the file is associated with, if applicable.
    ///   - logger: Logger use during operation
    @inlinable
    public func importDocument(
        appId: String,
        cardId: String,
        fileContentsBase64: String,
        fileName: String,
        instanceId: String,
        scope: DocumentScope,
        sessionId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ImportDocumentOutput {
        let input = ImportDocumentInput(
            appId: appId, 
            cardId: cardId, 
            fileContentsBase64: fileContentsBase64, 
            fileName: fileName, 
            instanceId: instanceId, 
            scope: scope, 
            sessionId: sessionId
        )
        return try await self.importDocument(input, logger: logger)
    }

    /// Lists the categories of a Amazon Q Business application environment instance. For more information, see Custom labels for Amazon Q Apps.
    @Sendable
    @inlinable
    public func listCategories(_ input: ListCategoriesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCategoriesOutput {
        try await self.client.execute(
            operation: "ListCategories", 
            path: "/catalog.listCategories", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the categories of a Amazon Q Business application environment instance. For more information, see Custom labels for Amazon Q Apps.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - logger: Logger use during operation
    @inlinable
    public func listCategories(
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCategoriesOutput {
        let input = ListCategoriesInput(
            instanceId: instanceId
        )
        return try await self.listCategories(input, logger: logger)
    }

    /// Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.
    @Sendable
    @inlinable
    public func listLibraryItems(_ input: ListLibraryItemsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListLibraryItemsOutput {
        try await self.client.execute(
            operation: "ListLibraryItems", 
            path: "/catalog.list", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.
    ///
    /// Parameters:
    ///   - categoryId: Optional category to filter the library items by.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - limit: The maximum number of library items to return in the response.
    ///   - nextToken: The token to request the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listLibraryItems(
        categoryId: String? = nil,
        instanceId: String,
        limit: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListLibraryItemsOutput {
        let input = ListLibraryItemsInput(
            categoryId: categoryId, 
            instanceId: instanceId, 
            limit: limit, 
            nextToken: nextToken
        )
        return try await self.listLibraryItems(input, logger: logger)
    }

    /// Lists the collected data of a Q App data collection session.
    @Sendable
    @inlinable
    public func listQAppSessionData(_ input: ListQAppSessionDataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListQAppSessionDataOutput {
        try await self.client.execute(
            operation: "ListQAppSessionData", 
            path: "/runtime.listQAppSessionData", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the collected data of a Q App data collection session.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App data collection session.
    ///   - logger: Logger use during operation
    @inlinable
    public func listQAppSessionData(
        instanceId: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListQAppSessionDataOutput {
        let input = ListQAppSessionDataInput(
            instanceId: instanceId, 
            sessionId: sessionId
        )
        return try await self.listQAppSessionData(input, logger: logger)
    }

    /// Lists the Amazon Q Apps owned by or associated with the user either because they created it or because they used it from the library in the past. The user identity is extracted from the credentials used to invoke this operation..
    @Sendable
    @inlinable
    public func listQApps(_ input: ListQAppsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListQAppsOutput {
        try await self.client.execute(
            operation: "ListQApps", 
            path: "/apps.list", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the Amazon Q Apps owned by or associated with the user either because they created it or because they used it from the library in the past. The user identity is extracted from the credentials used to invoke this operation..
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - limit: The maximum number of Q Apps to return in the response.
    ///   - nextToken: The token to request the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listQApps(
        instanceId: String,
        limit: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListQAppsOutput {
        let input = ListQAppsInput(
            instanceId: instanceId, 
            limit: limit, 
            nextToken: nextToken
        )
        return try await self.listQApps(input, logger: logger)
    }

    /// Lists the tags associated with an Amazon Q Apps resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceARN}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags associated with an Amazon Q Apps resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the resource whose tags should be listed.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceARN: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceARN: resourceARN
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Generates an Amazon Q App definition based on either a conversation or a problem statement provided as input.The resulting app definition can be used to call CreateQApp. This API doesn't create Amazon Q Apps directly.
    @Sendable
    @inlinable
    public func predictQApp(_ input: PredictQAppInput, logger: Logger = AWSClient.loggingDisabled) async throws -> PredictQAppOutput {
        try await self.client.execute(
            operation: "PredictQApp", 
            path: "/apps.predictQApp", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Generates an Amazon Q App definition based on either a conversation or a problem statement provided as input.The resulting app definition can be used to call CreateQApp. This API doesn't create Amazon Q Apps directly.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - options: The input to generate the Q App definition from, either a conversation or problem statement.
    ///   - logger: Logger use during operation
    @inlinable
    public func predictQApp(
        instanceId: String,
        options: PredictQAppInputOptions? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PredictQAppOutput {
        let input = PredictQAppInput(
            instanceId: instanceId, 
            options: options
        )
        return try await self.predictQApp(input, logger: logger)
    }

    /// Starts a new session for an Amazon Q App, allowing inputs to be provided and the app to be run.  Each Q App session will be condensed into a single conversation in the web experience.
    @Sendable
    @inlinable
    public func startQAppSession(_ input: StartQAppSessionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StartQAppSessionOutput {
        try await self.client.execute(
            operation: "StartQAppSession", 
            path: "/runtime.startQAppSession", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts a new session for an Amazon Q App, allowing inputs to be provided and the app to be run.  Each Q App session will be condensed into a single conversation in the web experience.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Q App to start a session for.
    ///   - appVersion: The version of the Q App to use for the session.
    ///   - initialValues: Optional initial input values to provide for the Q App session.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the a Q App session.
    ///   - tags: Optional tags to associate with the new Q App session.
    ///   - logger: Logger use during operation
    @inlinable
    public func startQAppSession(
        appId: String,
        appVersion: Int,
        initialValues: [CardValue]? = nil,
        instanceId: String,
        sessionId: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartQAppSessionOutput {
        let input = StartQAppSessionInput(
            appId: appId, 
            appVersion: appVersion, 
            initialValues: initialValues, 
            instanceId: instanceId, 
            sessionId: sessionId, 
            tags: tags
        )
        return try await self.startQAppSession(input, logger: logger)
    }

    /// Stops an active session for an Amazon Q App.This deletes all data related to the session and makes it invalid for future uses. The results of the session will be persisted as part of the conversation.
    @Sendable
    @inlinable
    public func stopQAppSession(_ input: StopQAppSessionInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "StopQAppSession", 
            path: "/runtime.deleteMiniAppRun", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops an active session for an Amazon Q App.This deletes all data related to the session and makes it invalid for future uses. The results of the session will be persisted as part of the conversation.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App session to stop.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopQAppSession(
        instanceId: String,
        sessionId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = StopQAppSessionInput(
            instanceId: instanceId, 
            sessionId: sessionId
        )
        return try await self.stopQAppSession(input, logger: logger)
    }

    /// Associates tags with an Amazon Q Apps resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceARN}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Associates tags with an Amazon Q Apps resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the resource to tag.
    ///   - tags: The tags to associate with the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceARN: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceARN: resourceARN, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Disassociates tags from an Amazon Q Apps resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceARN}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disassociates tags from an Amazon Q Apps resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Name (ARN) of the resource to disassociate the tag from.
    ///   - tagKeys: The keys of the tags to disassociate from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceARN: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceARN: resourceARN, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates the library item for an Amazon Q App.
    @Sendable
    @inlinable
    public func updateLibraryItem(_ input: UpdateLibraryItemInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateLibraryItemOutput {
        try await self.client.execute(
            operation: "UpdateLibraryItem", 
            path: "/catalog.updateItem", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the library item for an Amazon Q App.
    ///
    /// Parameters:
    ///   - categories: The new categories to associate with the library item.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - libraryItemId: The unique identifier of the library item to update.
    ///   - status: The new status to set for the library item, such as "Published" or "Hidden".
    ///   - logger: Logger use during operation
    @inlinable
    public func updateLibraryItem(
        categories: [String]? = nil,
        instanceId: String,
        libraryItemId: String,
        status: LibraryItemStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateLibraryItemOutput {
        let input = UpdateLibraryItemInput(
            categories: categories, 
            instanceId: instanceId, 
            libraryItemId: libraryItemId, 
            status: status
        )
        return try await self.updateLibraryItem(input, logger: logger)
    }

    /// Updates the verification status of a library item for an Amazon Q App.
    @Sendable
    @inlinable
    public func updateLibraryItemMetadata(_ input: UpdateLibraryItemMetadataInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateLibraryItemMetadata", 
            path: "/catalog.updateItemMetadata", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the verification status of a library item for an Amazon Q App.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - isVerified: The verification status of the library item
    ///   - libraryItemId: The unique identifier of the updated library item.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateLibraryItemMetadata(
        instanceId: String,
        isVerified: Bool? = nil,
        libraryItemId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateLibraryItemMetadataInput(
            instanceId: instanceId, 
            isVerified: isVerified, 
            libraryItemId: libraryItemId
        )
        return try await self.updateLibraryItemMetadata(input, logger: logger)
    }

    /// Updates an existing Amazon Q App, allowing modifications to its title, description, and definition.
    @Sendable
    @inlinable
    public func updateQApp(_ input: UpdateQAppInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateQAppOutput {
        try await self.client.execute(
            operation: "UpdateQApp", 
            path: "/apps.update", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing Amazon Q App, allowing modifications to its title, description, and definition.
    ///
    /// Parameters:
    ///   - appDefinition: The new definition specifying the cards and flow for the Q App.
    ///   - appId: The unique identifier of the Q App to update.
    ///   - description: The new description for the Q App.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - title: The new title for the Q App.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateQApp(
        appDefinition: AppDefinitionInput? = nil,
        appId: String,
        description: String? = nil,
        instanceId: String,
        title: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateQAppOutput {
        let input = UpdateQAppInput(
            appDefinition: appDefinition, 
            appId: appId, 
            description: description, 
            instanceId: instanceId, 
            title: title
        )
        return try await self.updateQApp(input, logger: logger)
    }

    /// Updates read permissions for a Amazon Q App in Amazon Q Business application environment instance.
    @Sendable
    @inlinable
    public func updateQAppPermissions(_ input: UpdateQAppPermissionsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateQAppPermissionsOutput {
        try await self.client.execute(
            operation: "UpdateQAppPermissions", 
            path: "/apps.updateQAppPermissions", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates read permissions for a Amazon Q App in Amazon Q Business application environment instance.
    ///
    /// Parameters:
    ///   - appId: The unique identifier of the Amazon Q App for which permissions are being updated.
    ///   - grantPermissions: The list of permissions to grant for the Amazon Q App.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - revokePermissions: The list of permissions to revoke for the Amazon Q App.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateQAppPermissions(
        appId: String,
        grantPermissions: [PermissionInput]? = nil,
        instanceId: String,
        revokePermissions: [PermissionInput]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateQAppPermissionsOutput {
        let input = UpdateQAppPermissionsInput(
            appId: appId, 
            grantPermissions: grantPermissions, 
            instanceId: instanceId, 
            revokePermissions: revokePermissions
        )
        return try await self.updateQAppPermissions(input, logger: logger)
    }

    /// Updates the session for a given Q App sessionId. This is only valid when at least one card of the session is in the WAITING state. Data for each WAITING card can be provided as input. If inputs are not provided, the call will be accepted but session will not move forward. Inputs for cards that are not in the WAITING status will be ignored.
    @Sendable
    @inlinable
    public func updateQAppSession(_ input: UpdateQAppSessionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateQAppSessionOutput {
        try await self.client.execute(
            operation: "UpdateQAppSession", 
            path: "/runtime.updateQAppSession", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the session for a given Q App sessionId. This is only valid when at least one card of the session is in the WAITING state. Data for each WAITING card can be provided as input. If inputs are not provided, the call will be accepted but session will not move forward. Inputs for cards that are not in the WAITING status will be ignored.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App session to provide input for.
    ///   - values: The input values to provide for the current state of the Q App session.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateQAppSession(
        instanceId: String,
        sessionId: String,
        values: [CardValue]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateQAppSessionOutput {
        let input = UpdateQAppSessionInput(
            instanceId: instanceId, 
            sessionId: sessionId, 
            values: values
        )
        return try await self.updateQAppSession(input, logger: logger)
    }

    /// Updates the configuration metadata of a session for a given Q App sessionId.
    @Sendable
    @inlinable
    public func updateQAppSessionMetadata(_ input: UpdateQAppSessionMetadataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateQAppSessionMetadataOutput {
        try await self.client.execute(
            operation: "UpdateQAppSessionMetadata", 
            path: "/runtime.updateQAppSessionMetadata", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the configuration metadata of a session for a given Q App sessionId.
    ///
    /// Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - sessionId: The unique identifier of the Q App session to update configuration for.
    ///   - sessionName: The new name for the Q App session.
    ///   - sharingConfiguration: The new sharing configuration for the Q App data collection session.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateQAppSessionMetadata(
        instanceId: String,
        sessionId: String,
        sessionName: String? = nil,
        sharingConfiguration: SessionSharingConfiguration,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateQAppSessionMetadataOutput {
        let input = UpdateQAppSessionMetadataInput(
            instanceId: instanceId, 
            sessionId: sessionId, 
            sessionName: sessionName, 
            sharingConfiguration: sharingConfiguration
        )
        return try await self.updateQAppSessionMetadata(input, logger: logger)
    }
}

extension QApps {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: QApps, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension QApps {
    /// Return PaginatorSequence for operation ``listLibraryItems(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listLibraryItemsPaginator(
        _ input: ListLibraryItemsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListLibraryItemsInput, ListLibraryItemsOutput> {
        return .init(
            input: input,
            command: self.listLibraryItems,
            inputKey: \ListLibraryItemsInput.nextToken,
            outputKey: \ListLibraryItemsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listLibraryItems(_:logger:)``.
    ///
    /// - Parameters:
    ///   - categoryId: Optional category to filter the library items by.
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - limit: The maximum number of library items to return in the response.
    ///   - logger: Logger used for logging
    @inlinable
    public func listLibraryItemsPaginator(
        categoryId: String? = nil,
        instanceId: String,
        limit: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListLibraryItemsInput, ListLibraryItemsOutput> {
        let input = ListLibraryItemsInput(
            categoryId: categoryId, 
            instanceId: instanceId, 
            limit: limit
        )
        return self.listLibraryItemsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listQApps(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listQAppsPaginator(
        _ input: ListQAppsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListQAppsInput, ListQAppsOutput> {
        return .init(
            input: input,
            command: self.listQApps,
            inputKey: \ListQAppsInput.nextToken,
            outputKey: \ListQAppsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listQApps(_:logger:)``.
    ///
    /// - Parameters:
    ///   - instanceId: The unique identifier of the Amazon Q Business application environment instance.
    ///   - limit: The maximum number of Q Apps to return in the response.
    ///   - logger: Logger used for logging
    @inlinable
    public func listQAppsPaginator(
        instanceId: String,
        limit: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListQAppsInput, ListQAppsOutput> {
        let input = ListQAppsInput(
            instanceId: instanceId, 
            limit: limit
        )
        return self.listQAppsPaginator(input, logger: logger)
    }
}

extension QApps.ListLibraryItemsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> QApps.ListLibraryItemsInput {
        return .init(
            categoryId: self.categoryId,
            instanceId: self.instanceId,
            limit: self.limit,
            nextToken: token
        )
    }
}

extension QApps.ListQAppsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> QApps.ListQAppsInput {
        return .init(
            instanceId: self.instanceId,
            limit: self.limit,
            nextToken: token
        )
    }
}
